﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Crossborder.Core.Migrations
{
    /// <inheritdoc />
    public partial class _25072003log : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<string>(
                name: "UserId",
                table: "UserPassword",
                type: "nvarchar(max)",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldComment: "用户Id");

            migrationBuilder.AlterColumn<string>(
                name: "Password",
                table: "UserPassword",
                type: "nvarchar(max)",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldComment: "密码");

            migrationBuilder.AlterColumn<DateTime>(
                name: "ModifyDate",
                table: "UserPassword",
                type: "dateTime2",
                nullable: false,
                comment: "修改时间",
                oldClrType: typeof(DateTime),
                oldType: "dateTime2");

            migrationBuilder.AlterColumn<bool>(
                name: "IsEnabled",
                table: "UserPassword",
                type: "bit",
                nullable: false,
                comment: "是否启用",
                oldClrType: typeof(bool),
                oldType: "bit");

            migrationBuilder.AlterColumn<bool>(
                name: "IsDelete",
                table: "UserPassword",
                type: "bit",
                nullable: false,
                comment: "是否删除",
                oldClrType: typeof(bool),
                oldType: "bit");

            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateDate",
                table: "UserPassword",
                type: "dateTime2",
                nullable: false,
                comment: "创建时间",
                oldClrType: typeof(DateTime),
                oldType: "dateTime2");

            migrationBuilder.AlterColumn<int>(
                name: "Id",
                table: "UserPassword",
                type: "int",
                nullable: false,
                comment: "主键Id",
                oldClrType: typeof(int),
                oldType: "int")
                .Annotation("SqlServer:Identity", "1, 1")
                .OldAnnotation("SqlServer:Identity", "1, 1");

            migrationBuilder.AlterColumn<DateTime>(
                name: "ModifyDate",
                table: "User",
                type: "dateTime2",
                nullable: false,
                comment: "修改时间",
                oldClrType: typeof(DateTime),
                oldType: "dateTime2");

            migrationBuilder.AlterColumn<bool>(
                name: "IsEnabled",
                table: "User",
                type: "bit",
                nullable: false,
                comment: "是否启用",
                oldClrType: typeof(bool),
                oldType: "bit");

            migrationBuilder.AlterColumn<bool>(
                name: "IsDelete",
                table: "User",
                type: "bit",
                nullable: false,
                comment: "是否删除",
                oldClrType: typeof(bool),
                oldType: "bit");

            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateDate",
                table: "User",
                type: "dateTime2",
                nullable: false,
                comment: "创建时间",
                oldClrType: typeof(DateTime),
                oldType: "dateTime2");

            migrationBuilder.AlterColumn<int>(
                name: "Id",
                table: "User",
                type: "int",
                nullable: false,
                comment: "主键Id",
                oldClrType: typeof(int),
                oldType: "int")
                .Annotation("SqlServer:Identity", "1, 1")
                .OldAnnotation("SqlServer:Identity", "1, 1");

            migrationBuilder.AlterColumn<string>(
                name: "Unit",
                table: "ProductSpecs",
                type: "nvarchar(max)",
                nullable: true,
                comment: "单位",
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "SpecsName",
                table: "ProductSpecs",
                type: "nvarchar(max)",
                nullable: false,
                comment: "规格名称",
                oldClrType: typeof(string),
                oldType: "nvarchar(max)");

            migrationBuilder.AlterColumn<string>(
                name: "ProductId",
                table: "ProductSpecs",
                type: "nvarchar(max)",
                nullable: false,
                comment: "产品Id",
                oldClrType: typeof(string),
                oldType: "nvarchar(max)");

            migrationBuilder.AlterColumn<string>(
                name: "ProSpecsId",
                table: "ProductSpecs",
                type: "nvarchar(max)",
                nullable: false,
                comment: "规格Id",
                oldClrType: typeof(string),
                oldType: "nvarchar(max)");

            migrationBuilder.AlterColumn<double>(
                name: "Price",
                table: "ProductSpecs",
                type: "float(18)",
                precision: 18,
                scale: 3,
                nullable: true,
                comment: "价格（保留后3位）",
                oldClrType: typeof(double),
                oldType: "float",
                oldNullable: true);

            migrationBuilder.AlterColumn<DateTime>(
                name: "ModifyDate",
                table: "ProductSpecs",
                type: "dateTime2",
                nullable: false,
                comment: "修改时间",
                oldClrType: typeof(DateTime),
                oldType: "dateTime2");

            migrationBuilder.AlterColumn<bool>(
                name: "IsEnabled",
                table: "ProductSpecs",
                type: "bit",
                nullable: false,
                comment: "是否启用",
                oldClrType: typeof(bool),
                oldType: "bit");

            migrationBuilder.AlterColumn<bool>(
                name: "IsDelete",
                table: "ProductSpecs",
                type: "bit",
                nullable: false,
                comment: "是否删除",
                oldClrType: typeof(bool),
                oldType: "bit");

            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateDate",
                table: "ProductSpecs",
                type: "dateTime2",
                nullable: false,
                comment: "创建时间",
                oldClrType: typeof(DateTime),
                oldType: "dateTime2");

            migrationBuilder.AlterColumn<int>(
                name: "Id",
                table: "ProductSpecs",
                type: "int",
                nullable: false,
                comment: "主键Id",
                oldClrType: typeof(int),
                oldType: "int")
                .Annotation("SqlServer:Identity", "1, 1")
                .OldAnnotation("SqlServer:Identity", "1, 1");

            migrationBuilder.AlterColumn<string>(
                name: "SubCategoryName",
                table: "ProductInfos",
                type: "nvarchar(max)",
                nullable: true,
                comment: "二级品类名称（用于冗余设计）",
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "SubCategoryId",
                table: "ProductInfos",
                type: "nvarchar(max)",
                nullable: true,
                comment: "二级品类Id",
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "ProductName",
                table: "ProductInfos",
                type: "nvarchar(max)",
                nullable: false,
                comment: "产品名称",
                oldClrType: typeof(string),
                oldType: "nvarchar(max)");

            migrationBuilder.AlterColumn<string>(
                name: "ProductId",
                table: "ProductInfos",
                type: "nvarchar(max)",
                nullable: false,
                comment: "产品Id",
                oldClrType: typeof(string),
                oldType: "nvarchar(max)");

            migrationBuilder.AlterColumn<DateTime>(
                name: "ModifyDate",
                table: "ProductInfos",
                type: "dateTime2",
                nullable: false,
                comment: "修改时间",
                oldClrType: typeof(DateTime),
                oldType: "dateTime2");

            migrationBuilder.AlterColumn<bool>(
                name: "IsEnabled",
                table: "ProductInfos",
                type: "bit",
                nullable: false,
                comment: "是否启用",
                oldClrType: typeof(bool),
                oldType: "bit");

            migrationBuilder.AlterColumn<bool>(
                name: "IsDelete",
                table: "ProductInfos",
                type: "bit",
                nullable: false,
                comment: "是否删除",
                oldClrType: typeof(bool),
                oldType: "bit");

            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateDate",
                table: "ProductInfos",
                type: "dateTime2",
                nullable: false,
                comment: "创建时间",
                oldClrType: typeof(DateTime),
                oldType: "dateTime2");

            migrationBuilder.AlterColumn<string>(
                name: "CategorytId",
                table: "ProductInfos",
                type: "nvarchar(max)",
                nullable: true,
                comment: "品类Id",
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "CategoryName",
                table: "ProductInfos",
                type: "nvarchar(max)",
                nullable: true,
                comment: "品类名称（用于冗余设计）",
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true);

            migrationBuilder.AlterColumn<int>(
                name: "Id",
                table: "ProductInfos",
                type: "int",
                nullable: false,
                comment: "主键Id",
                oldClrType: typeof(int),
                oldType: "int")
                .Annotation("SqlServer:Identity", "1, 1")
                .OldAnnotation("SqlServer:Identity", "1, 1");

            migrationBuilder.AlterColumn<string>(
                name: "ParentId",
                table: "Categorys",
                type: "nvarchar(max)",
                nullable: true,
                comment: "品类父级Id（默认为 0）",
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true);

            migrationBuilder.AlterColumn<DateTime>(
                name: "ModifyDate",
                table: "Categorys",
                type: "dateTime2",
                nullable: false,
                comment: "修改时间",
                oldClrType: typeof(DateTime),
                oldType: "dateTime2");

            migrationBuilder.AlterColumn<int>(
                name: "Level",
                table: "Categorys",
                type: "int",
                nullable: true,
                comment: "等级（默认为 0）",
                oldClrType: typeof(int),
                oldType: "int",
                oldNullable: true);

            migrationBuilder.AlterColumn<bool>(
                name: "IsEnabled",
                table: "Categorys",
                type: "bit",
                nullable: false,
                comment: "是否启用",
                oldClrType: typeof(bool),
                oldType: "bit");

            migrationBuilder.AlterColumn<bool>(
                name: "IsDelete",
                table: "Categorys",
                type: "bit",
                nullable: false,
                comment: "是否删除",
                oldClrType: typeof(bool),
                oldType: "bit");

            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateDate",
                table: "Categorys",
                type: "dateTime2",
                nullable: false,
                comment: "创建时间",
                oldClrType: typeof(DateTime),
                oldType: "dateTime2");

            migrationBuilder.AlterColumn<string>(
                name: "CategoryName",
                table: "Categorys",
                type: "nvarchar(max)",
                nullable: false,
                comment: "品类名称",
                oldClrType: typeof(string),
                oldType: "nvarchar(max)");

            migrationBuilder.AlterColumn<string>(
                name: "CategoryId",
                table: "Categorys",
                type: "nvarchar(max)",
                nullable: false,
                comment: "品类Id",
                oldClrType: typeof(string),
                oldType: "nvarchar(max)");

            migrationBuilder.AlterColumn<int>(
                name: "Id",
                table: "Categorys",
                type: "int",
                nullable: false,
                comment: "主键Id",
                oldClrType: typeof(int),
                oldType: "int")
                .Annotation("SqlServer:Identity", "1, 1")
                .OldAnnotation("SqlServer:Identity", "1, 1");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<string>(
                name: "UserId",
                table: "UserPassword",
                type: "nvarchar(max)",
                nullable: false,
                comment: "用户Id",
                oldClrType: typeof(string),
                oldType: "nvarchar(max)");

            migrationBuilder.AlterColumn<string>(
                name: "Password",
                table: "UserPassword",
                type: "nvarchar(max)",
                nullable: false,
                comment: "密码",
                oldClrType: typeof(string),
                oldType: "nvarchar(max)");

            migrationBuilder.AlterColumn<DateTime>(
                name: "ModifyDate",
                table: "UserPassword",
                type: "dateTime2",
                nullable: false,
                oldClrType: typeof(DateTime),
                oldType: "dateTime2",
                oldComment: "修改时间");

            migrationBuilder.AlterColumn<bool>(
                name: "IsEnabled",
                table: "UserPassword",
                type: "bit",
                nullable: false,
                oldClrType: typeof(bool),
                oldType: "bit",
                oldComment: "是否启用");

            migrationBuilder.AlterColumn<bool>(
                name: "IsDelete",
                table: "UserPassword",
                type: "bit",
                nullable: false,
                oldClrType: typeof(bool),
                oldType: "bit",
                oldComment: "是否删除");

            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateDate",
                table: "UserPassword",
                type: "dateTime2",
                nullable: false,
                oldClrType: typeof(DateTime),
                oldType: "dateTime2",
                oldComment: "创建时间");

            migrationBuilder.AlterColumn<int>(
                name: "Id",
                table: "UserPassword",
                type: "int",
                nullable: false,
                oldClrType: typeof(int),
                oldType: "int",
                oldComment: "主键Id")
                .Annotation("SqlServer:Identity", "1, 1")
                .OldAnnotation("SqlServer:Identity", "1, 1");

            migrationBuilder.AlterColumn<DateTime>(
                name: "ModifyDate",
                table: "User",
                type: "dateTime2",
                nullable: false,
                oldClrType: typeof(DateTime),
                oldType: "dateTime2",
                oldComment: "修改时间");

            migrationBuilder.AlterColumn<bool>(
                name: "IsEnabled",
                table: "User",
                type: "bit",
                nullable: false,
                oldClrType: typeof(bool),
                oldType: "bit",
                oldComment: "是否启用");

            migrationBuilder.AlterColumn<bool>(
                name: "IsDelete",
                table: "User",
                type: "bit",
                nullable: false,
                oldClrType: typeof(bool),
                oldType: "bit",
                oldComment: "是否删除");

            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateDate",
                table: "User",
                type: "dateTime2",
                nullable: false,
                oldClrType: typeof(DateTime),
                oldType: "dateTime2",
                oldComment: "创建时间");

            migrationBuilder.AlterColumn<int>(
                name: "Id",
                table: "User",
                type: "int",
                nullable: false,
                oldClrType: typeof(int),
                oldType: "int",
                oldComment: "主键Id")
                .Annotation("SqlServer:Identity", "1, 1")
                .OldAnnotation("SqlServer:Identity", "1, 1");

            migrationBuilder.AlterColumn<string>(
                name: "Unit",
                table: "ProductSpecs",
                type: "nvarchar(max)",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true,
                oldComment: "单位");

            migrationBuilder.AlterColumn<string>(
                name: "SpecsName",
                table: "ProductSpecs",
                type: "nvarchar(max)",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldComment: "规格名称");

            migrationBuilder.AlterColumn<string>(
                name: "ProductId",
                table: "ProductSpecs",
                type: "nvarchar(max)",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldComment: "产品Id");

            migrationBuilder.AlterColumn<string>(
                name: "ProSpecsId",
                table: "ProductSpecs",
                type: "nvarchar(max)",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldComment: "规格Id");

            migrationBuilder.AlterColumn<double>(
                name: "Price",
                table: "ProductSpecs",
                type: "float",
                nullable: true,
                oldClrType: typeof(double),
                oldType: "float(18)",
                oldPrecision: 18,
                oldScale: 3,
                oldNullable: true,
                oldComment: "价格（保留后3位）");

            migrationBuilder.AlterColumn<DateTime>(
                name: "ModifyDate",
                table: "ProductSpecs",
                type: "dateTime2",
                nullable: false,
                oldClrType: typeof(DateTime),
                oldType: "dateTime2",
                oldComment: "修改时间");

            migrationBuilder.AlterColumn<bool>(
                name: "IsEnabled",
                table: "ProductSpecs",
                type: "bit",
                nullable: false,
                oldClrType: typeof(bool),
                oldType: "bit",
                oldComment: "是否启用");

            migrationBuilder.AlterColumn<bool>(
                name: "IsDelete",
                table: "ProductSpecs",
                type: "bit",
                nullable: false,
                oldClrType: typeof(bool),
                oldType: "bit",
                oldComment: "是否删除");

            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateDate",
                table: "ProductSpecs",
                type: "dateTime2",
                nullable: false,
                oldClrType: typeof(DateTime),
                oldType: "dateTime2",
                oldComment: "创建时间");

            migrationBuilder.AlterColumn<int>(
                name: "Id",
                table: "ProductSpecs",
                type: "int",
                nullable: false,
                oldClrType: typeof(int),
                oldType: "int",
                oldComment: "主键Id")
                .Annotation("SqlServer:Identity", "1, 1")
                .OldAnnotation("SqlServer:Identity", "1, 1");

            migrationBuilder.AlterColumn<string>(
                name: "SubCategoryName",
                table: "ProductInfos",
                type: "nvarchar(max)",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true,
                oldComment: "二级品类名称（用于冗余设计）");

            migrationBuilder.AlterColumn<string>(
                name: "SubCategoryId",
                table: "ProductInfos",
                type: "nvarchar(max)",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true,
                oldComment: "二级品类Id");

            migrationBuilder.AlterColumn<string>(
                name: "ProductName",
                table: "ProductInfos",
                type: "nvarchar(max)",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldComment: "产品名称");

            migrationBuilder.AlterColumn<string>(
                name: "ProductId",
                table: "ProductInfos",
                type: "nvarchar(max)",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldComment: "产品Id");

            migrationBuilder.AlterColumn<DateTime>(
                name: "ModifyDate",
                table: "ProductInfos",
                type: "dateTime2",
                nullable: false,
                oldClrType: typeof(DateTime),
                oldType: "dateTime2",
                oldComment: "修改时间");

            migrationBuilder.AlterColumn<bool>(
                name: "IsEnabled",
                table: "ProductInfos",
                type: "bit",
                nullable: false,
                oldClrType: typeof(bool),
                oldType: "bit",
                oldComment: "是否启用");

            migrationBuilder.AlterColumn<bool>(
                name: "IsDelete",
                table: "ProductInfos",
                type: "bit",
                nullable: false,
                oldClrType: typeof(bool),
                oldType: "bit",
                oldComment: "是否删除");

            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateDate",
                table: "ProductInfos",
                type: "dateTime2",
                nullable: false,
                oldClrType: typeof(DateTime),
                oldType: "dateTime2",
                oldComment: "创建时间");

            migrationBuilder.AlterColumn<string>(
                name: "CategorytId",
                table: "ProductInfos",
                type: "nvarchar(max)",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true,
                oldComment: "品类Id");

            migrationBuilder.AlterColumn<string>(
                name: "CategoryName",
                table: "ProductInfos",
                type: "nvarchar(max)",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true,
                oldComment: "品类名称（用于冗余设计）");

            migrationBuilder.AlterColumn<int>(
                name: "Id",
                table: "ProductInfos",
                type: "int",
                nullable: false,
                oldClrType: typeof(int),
                oldType: "int",
                oldComment: "主键Id")
                .Annotation("SqlServer:Identity", "1, 1")
                .OldAnnotation("SqlServer:Identity", "1, 1");

            migrationBuilder.AlterColumn<string>(
                name: "ParentId",
                table: "Categorys",
                type: "nvarchar(max)",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true,
                oldComment: "品类父级Id（默认为 0）");

            migrationBuilder.AlterColumn<DateTime>(
                name: "ModifyDate",
                table: "Categorys",
                type: "dateTime2",
                nullable: false,
                oldClrType: typeof(DateTime),
                oldType: "dateTime2",
                oldComment: "修改时间");

            migrationBuilder.AlterColumn<int>(
                name: "Level",
                table: "Categorys",
                type: "int",
                nullable: true,
                oldClrType: typeof(int),
                oldType: "int",
                oldNullable: true,
                oldComment: "等级（默认为 0）");

            migrationBuilder.AlterColumn<bool>(
                name: "IsEnabled",
                table: "Categorys",
                type: "bit",
                nullable: false,
                oldClrType: typeof(bool),
                oldType: "bit",
                oldComment: "是否启用");

            migrationBuilder.AlterColumn<bool>(
                name: "IsDelete",
                table: "Categorys",
                type: "bit",
                nullable: false,
                oldClrType: typeof(bool),
                oldType: "bit",
                oldComment: "是否删除");

            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateDate",
                table: "Categorys",
                type: "dateTime2",
                nullable: false,
                oldClrType: typeof(DateTime),
                oldType: "dateTime2",
                oldComment: "创建时间");

            migrationBuilder.AlterColumn<string>(
                name: "CategoryName",
                table: "Categorys",
                type: "nvarchar(max)",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldComment: "品类名称");

            migrationBuilder.AlterColumn<string>(
                name: "CategoryId",
                table: "Categorys",
                type: "nvarchar(max)",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldComment: "品类Id");

            migrationBuilder.AlterColumn<int>(
                name: "Id",
                table: "Categorys",
                type: "int",
                nullable: false,
                oldClrType: typeof(int),
                oldType: "int",
                oldComment: "主键Id")
                .Annotation("SqlServer:Identity", "1, 1")
                .OldAnnotation("SqlServer:Identity", "1, 1");
        }
    }
}
